import Captcha from "svg-captcha"
import Express from "express"
export const CaptchaRouter = Express.Router()
CaptchaRouter.get("/", async (req, res) => {
    const obj = Captcha.create({
        size: 4,
        ignoreChars: "0o1i",
        noise: 0,
        color: true
    });
    req.session.code = obj.text
    console.log(obj.text);
    
    // res.send(obj.data)
    res.json({
        code:0,
        data:obj.data,
        msg:"OK"
    })
    // console.log("obj.data",obj.data);
    
})